package com.example.springbootserve.mapper;

import com.example.springbootserve.controller.Request.BaseRquest;
import com.example.springbootserve.entity.Book;
import com.example.springbootserve.entity.Borrow;
import com.example.springbootserve.entity.Retur;
import com.example.springbootserve.mapper.po.BorrowReturCountPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface BorrowMapper {

    List<Borrow> list();

    List<Borrow> listByCondition(BaseRquest baseRquest);


    List<Retur> listReturByCondition(BaseRquest baseRquest);

    void save(Borrow obj);

    void saveRetur(Retur obj);

    Borrow getById(Integer id);

    void updateById(Borrow obj);

    void deleteById(Integer id);

    void deleteReturById(Integer id);

    void updateStatus(String status , Integer id);

    List<BorrowReturCountPO> getCountByTimeRange(@Param("timeRange") String timeRange, @Param("type") int i);       //1 是borrow 2是retur
}
